<!DOCTYPE html>
<html lang="zh-CN">
  <head>

	  <include file="Public:header"/>
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
 	<include file="Public:body_top"/>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar hidden-xs">
          <div class="menu">
            <dl>
              <dt><i class="cm-order"></i>小程序设置</dt>
              <dd class="active"><a href="{:U('Admins/app_edit')}">小程序修改</a></dd>
            </dl>
            <dl>
              <dt><i class="cm-advert"></i>广告管理</dt>
              <dd><a href="{:U('Admins/adverts_index')}">广告列表</a></dd>
              <dd><a href="{:U('Admins/advert_new')}">新建广告</a></dd>
            </dl>
          </div>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <div class="main-hd">
            <h5>编辑小程序</h5>
          </div>

          <div class="main-bd">
            <div class="form-box" >
              <form class="form-horizontal" id="myform" method="post" enctype="multipart/form-data" action="{:U('Admins/app_update')}"  onsubmit="return validata();">
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >小程序名称</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="name" id="name" value="{$app.name}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >小程序客服微信</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="kfwechat" id="kfwechat" value="{$app.kfwechat}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >小程序客服手机</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="kfphone" id="kfphone" value="{$app.kfphone}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >小程序APPID</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="cappid_applet" id="cappid_applet" value="{$app.cappid_applet}">
                  </div>
                  <label class="col-sm-2 control-label"  >小程序APPSECRET</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="cappsecret_applet" id="cappsecret_applet" value="{$app.cappsecret_applet}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >微信支付MCHID</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="mch_id" id="mch_id" value="{$app.mch_id}">
                  </div>
                  <label class="col-sm-2 control-label"  >微信支付KEY</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="xcx_key" id="xcx_key" value="{$app.xcx_key}">
                  </div>
                </div>
                
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >商户审核消息模板</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="shop_audit_template_id" id="shop_audit_template_id" value="{$app.shop_audit_template_id}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >订单确认消息模板</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="confirm_order_template_id " id="confirm_order_template_id " value="{$app.confirm_order_template_id}">
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label"  >发货通知消息模板</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="express_order_template_id" id="express_order_template_id" value="{$app.express_order_template_id}">
                  </div>
                </div>


                <div class="form-group">
                  <label class="col-sm-2 control-label"  >又拍云Host</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="upyun_host" id="upyun_host" value="{$app.upyun_host}">
                  </div>
                  <label class="col-sm-2 control-label"  >又拍云Bucket</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="upyun_bucket" id="upyun_bucket" value="{$app.upyun_bucket}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >又拍云操作员</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="upyun_username" id="upyun_username" value="{$app.upyun_username}">
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label"  >又拍云操作员密码</label>
                    <div class="col-sm-3">
                      <input type="text" class="form-control" name="upyun_password" id="upyun_password" value="{$app.upyun_password}">
                    </div>
                </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >又拍云Endpoint</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="upyun_endpoint" id="upyun_endpoint" value="{$app.upyun_endpoint}">
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label"  >阿⾥短信AppKey</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="smsct_appkey" id="smsct_appkey" value="{$app.smsct_appkey}">
                  </div>
                  <label class="col-sm-2 control-label"  >阿⾥短信SecretKey</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="smsct_secretkey" id="smsct_secretkey" value="{$app.smsct_secretkey}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >阿⾥短信验证码模板</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="smsct_tpcode" id="smsct_tpcode" value="{$app.smsct_tpcode}">
                  </div>
                  <label class="col-sm-2 control-label"  >阿⾥短信订单提醒模板</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="smsct_ordertpcode" id="smsct_ordertpcode" value="{$app.smsct_ordertpcode}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >阿⾥短信签名</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="smsct_signname" id="smsct_signname" value="{$app.smsct_signname}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >支付宝打款 <br/>(rsaPrivateKey)</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="alipay_rsaprivatekey" id="alipay_rsaprivatekey" value="{$app.alipay_rsaprivatekey}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >支付宝打款<br/>(alipayrsaPublicKey)</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="alipay_rsapublickey" id="alipay_rsapublickey" value="{$app.alipay_rsapublickey}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label"  >支付宝打款AppId</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" name="alipay_appid" id="alipay_appid" value="{$app.alipay_appid}">
                  </div>
                </div>


                <div class="form-group">
                  <div class="col-sm-offset-2 col-sm-10">
                    <input type="hidden" name="id" value="{$app.id}">
                    <input type="submit" class="btn btn-primary" value="提交">
                    
                    <!-- <a class="btn btn-default" href="{:U('admins/app_export')}">导出小程序配置</a> -->
                    <!-- <a class="btn btn-default" href="{:U('admins/export_xcx')}">导出小程序</a> -->
                    <!-- <a class="btn btn-default" href="{:U('admins/app_show')}">返回</a> -->
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>


<script>



function validata()
{

	$("#myform").ajaxSubmit({
		type: 'post', // 提交方式 get/post
		url: "{:U('admins/app_update')}", // 需要提交的 url
		datatype:"json",
		success: function(data) { // data 保存提交后返回的数据，一般为 json 数据
			// 此处可对 data 作相关处理
			if(data['code']!='success')
			{
			 	save(data['msg']);
			}
			else
			{
				save(data['msg']);
			 	location.href="{:U('admins/app_show')}";
			}


		}
	});

	return false;
}






</script>
  </body>
</html>
